﻿'######################################################################################################################################
'# CLASSE SKIN:
'#  - Fonctions de manipulation des objets du Skin:
'#       * SKINSKINIMG_Separateur_Visible(index de 0 a 15, valeur)
'#       * SKINSKINIMG_Type_Setfilename(index de 0 a 14, valeur)
'#       * SKINSKINLBL_Texte_Label(index de 0 a 14, couleur,valeur)
'#       * SKINSKINIMG_Vu_Setfilename(index de 0 a 14, valeur)
'######################################################################################################################################
Imports MediaPortal.Dialogs
Imports MediaPortal.GUI.Library

Public Class Skin

    Private _Parent As Plugin

    '######################################################################################################################################
    '# Constructeur
    '######################################################################################################################################
    Public Sub New(ByVal CLASS_Param1 As Plugin)
        _Parent = CLASS_Param1
    End Sub
    '######################################################################################################################################

    Public Sub SKINSKINIMG_Separateur_Visible(ByVal INT_PARAM1 As Integer, ByVal BOOL_PARAM2 As Boolean)
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de SKINSKINIMG_Separateur_Visible()", "")
        Select Case INT_PARAM1
            Case 0
                _Parent.SKINIMG_Separateur00.Visible = BOOL_PARAM2
            Case 1
                _Parent.SKINIMG_Separateur01.Visible = BOOL_PARAM2
            Case 2
                _Parent.SKINIMG_Separateur02.Visible = BOOL_PARAM2
            Case 3
                _Parent.SKINIMG_Separateur03.Visible = BOOL_PARAM2
            Case 4
                _Parent.SKINIMG_Separateur04.Visible = BOOL_PARAM2
            Case 5
                _Parent.SKINIMG_Separateur05.Visible = BOOL_PARAM2
            Case 6
                _Parent.SKINIMG_Separateur06.Visible = BOOL_PARAM2
            Case 7
                _Parent.SKINIMG_Separateur07.Visible = BOOL_PARAM2
            Case 8
                _Parent.SKINIMG_Separateur08.Visible = BOOL_PARAM2
            Case 9
                _Parent.SKINIMG_Separateur09.Visible = BOOL_PARAM2
            Case 10
                _Parent.SKINIMG_Separateur10.Visible = BOOL_PARAM2
            Case 11
                _Parent.SKINIMG_Separateur11.Visible = BOOL_PARAM2
            Case 12
                _Parent.SKINIMG_Separateur12.Visible = BOOL_PARAM2
            Case 13
                _Parent.SKINIMG_Separateur13.Visible = BOOL_PARAM2
            Case 14
                _Parent.SKINIMG_Separateur14.Visible = BOOL_PARAM2
            Case 15
                _Parent.SKINIMG_Separateur15.Visible = BOOL_PARAM2
        End Select
    End Sub

    Public Sub SKINIMG_Type_Setfilename(ByVal INT_PARAM1 As Integer, ByVal STR_PARAM2 As String)
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de SKINIMG_Type_Setfilename()", "")
        Select Case INT_PARAM1
            Case 0
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type00.Visible = False
                Else
                    _Parent.SKINIMG_Type00.Visible = True
                    _Parent.SKINIMG_Type00.SetFileName(STR_PARAM2)
                End If
            Case 1
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type01.Visible = False
                Else
                    _Parent.SKINIMG_Type01.Visible = True
                    _Parent.SKINIMG_Type01.SetFileName(STR_PARAM2)
                End If
            Case 2
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type02.Visible = False
                Else
                    _Parent.SKINIMG_Type02.Visible = True
                    _Parent.SKINIMG_Type02.SetFileName(STR_PARAM2)
                End If
            Case 3
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type03.Visible = False
                Else
                    _Parent.SKINIMG_Type03.Visible = True
                    _Parent.SKINIMG_Type03.SetFileName(STR_PARAM2)
                End If
            Case 4
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type04.Visible = False
                Else
                    _Parent.SKINIMG_Type04.Visible = True
                    _Parent.SKINIMG_Type04.SetFileName(STR_PARAM2)
                End If
            Case 5
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type05.Visible = False
                Else
                    _Parent.SKINIMG_Type05.Visible = True
                    _Parent.SKINIMG_Type05.SetFileName(STR_PARAM2)
                End If
            Case 6
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type06.Visible = False
                Else
                    _Parent.SKINIMG_Type06.Visible = True
                    _Parent.SKINIMG_Type06.SetFileName(STR_PARAM2)
                End If
            Case 7
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type07.Visible = False
                Else
                    _Parent.SKINIMG_Type07.Visible = True
                    _Parent.SKINIMG_Type07.SetFileName(STR_PARAM2)
                End If
            Case 8
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type08.Visible = False
                Else
                    _Parent.SKINIMG_Type08.Visible = True
                    _Parent.SKINIMG_Type08.SetFileName(STR_PARAM2)
                End If
            Case 9
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type09.Visible = False
                Else
                    _Parent.SKINIMG_Type09.Visible = True
                    _Parent.SKINIMG_Type09.SetFileName(STR_PARAM2)
                End If
            Case 10
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type10.Visible = False
                Else
                    _Parent.SKINIMG_Type10.Visible = True
                    _Parent.SKINIMG_Type10.SetFileName(STR_PARAM2)
                End If
            Case 11
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type11.Visible = False
                Else
                    _Parent.SKINIMG_Type11.Visible = True
                    _Parent.SKINIMG_Type11.SetFileName(STR_PARAM2)
                End If
            Case 12
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type12.Visible = False
                Else
                    _Parent.SKINIMG_Type12.Visible = True
                    _Parent.SKINIMG_Type12.SetFileName(STR_PARAM2)
                End If
            Case 13
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type13.Visible = False
                Else
                    _Parent.SKINIMG_Type13.Visible = True
                    _Parent.SKINIMG_Type13.SetFileName(STR_PARAM2)
                End If
            Case 14
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Type14.Visible = False
                Else
                    _Parent.SKINIMG_Type14.Visible = True
                    _Parent.SKINIMG_Type14.SetFileName(STR_PARAM2)
                End If
        End Select
    End Sub

    Public Sub SKINLBL_Texte_Label(ByVal INT_PARAM1 As Integer, ByVal STR_PARAM2 As String, ByVal STR_PARAM3 As String)
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de SKINLBL_Texte_Label()", "")
        Select Case INT_PARAM1
            Case 0
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte00.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte00.Label = STR_PARAM3
            Case 1
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte01.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte01.Label = STR_PARAM3
            Case 2
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte02.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte02.Label = STR_PARAM3
            Case 3
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte03.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte03.Label = STR_PARAM3
            Case 4
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte04.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte04.Label = STR_PARAM3
            Case 5
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte05.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte05.Label = STR_PARAM3
            Case 6
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte06.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte06.Label = STR_PARAM3
            Case 7
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte07.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte07.Label = STR_PARAM3
            Case 8
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte08.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte08.Label = STR_PARAM3
            Case 9
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte09.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte09.Label = STR_PARAM3
            Case 10
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte10.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte10.Label = STR_PARAM3
            Case 11
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte11.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte11.Label = STR_PARAM3
            Case 12
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte12.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte12.Label = STR_PARAM3
            Case 13
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte13.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte13.Label = STR_PARAM3
            Case 14
                If STR_PARAM2 <> "" Then _Parent.SKINLBL_Texte14.TextColor = STR_PARAM2
                _Parent.SKINLBL_Texte14.Label = STR_PARAM3
        End Select
    End Sub

    Public Sub SKINIMG_Vu_Setfilename(ByVal INT_PARAM1 As Integer, ByVal STR_PARAM2 As String)
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de SKINIMG_Vu_Setfilename()", "")
        Select Case INT_PARAM1
            Case 0
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu00.Visible = False
                Else
                    _Parent.SKINIMG_Vu00.Visible = True
                    _Parent.SKINIMG_Vu00.SetFileName(STR_PARAM2)
                End If
            Case 1
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu01.Visible = False
                Else
                    _Parent.SKINIMG_Vu01.Visible = True
                    _Parent.SKINIMG_Vu01.SetFileName(STR_PARAM2)
                End If
            Case 2
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu02.Visible = False
                Else
                    _Parent.SKINIMG_Vu02.Visible = True
                    _Parent.SKINIMG_Vu02.SetFileName(STR_PARAM2)
                End If
            Case 3
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu03.Visible = False
                Else
                    _Parent.SKINIMG_Vu03.Visible = True
                    _Parent.SKINIMG_Vu03.SetFileName(STR_PARAM2)
                End If
            Case 4
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu04.Visible = False
                Else
                    _Parent.SKINIMG_Vu04.Visible = True
                    _Parent.SKINIMG_Vu04.SetFileName(STR_PARAM2)
                End If
            Case 5
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu05.Visible = False
                Else
                    _Parent.SKINIMG_Vu05.Visible = True
                    _Parent.SKINIMG_Vu05.SetFileName(STR_PARAM2)
                End If
            Case 6
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu06.Visible = False
                Else
                    _Parent.SKINIMG_Vu06.Visible = True
                    _Parent.SKINIMG_Vu06.SetFileName(STR_PARAM2)
                End If
            Case 7
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu07.Visible = False
                Else
                    _Parent.SKINIMG_Vu07.Visible = True
                    _Parent.SKINIMG_Vu07.SetFileName(STR_PARAM2)
                End If
            Case 8
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu08.Visible = False
                Else
                    _Parent.SKINIMG_Vu08.Visible = True
                    _Parent.SKINIMG_Vu08.SetFileName(STR_PARAM2)
                End If
            Case 9
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu09.Visible = False
                Else
                    _Parent.SKINIMG_Vu09.Visible = True
                    _Parent.SKINIMG_Vu09.SetFileName(STR_PARAM2)
                End If
            Case 10
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu10.Visible = False
                Else
                    _Parent.SKINIMG_Vu10.Visible = True
                    _Parent.SKINIMG_Vu10.SetFileName(STR_PARAM2)
                End If
            Case 11
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu11.Visible = False
                Else
                    _Parent.SKINIMG_Vu11.Visible = True
                    _Parent.SKINIMG_Vu11.SetFileName(STR_PARAM2)
                End If
            Case 12
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu12.Visible = False
                Else
                    _Parent.SKINIMG_Vu12.Visible = True
                    _Parent.SKINIMG_Vu12.SetFileName(STR_PARAM2)
                End If
            Case 13
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu13.Visible = False
                Else
                    _Parent.SKINIMG_Vu13.Visible = True
                    _Parent.SKINIMG_Vu13.SetFileName(STR_PARAM2)
                End If
            Case 14
                If STR_PARAM2 = "" Then
                    _Parent.SKINIMG_Vu14.Visible = False
                Else
                    _Parent.SKINIMG_Vu14.Visible = True
                    _Parent.SKINIMG_Vu14.SetFileName(STR_PARAM2)
                End If
        End Select
    End Sub

    Public Function Relative_X(ByVal INT_PARAM1 As Integer) As Integer
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de Relative_X()", "")
        Return (_Parent.SKINIMG_Fond_Ecran.Width / 1280) * INT_PARAM1
    End Function

    Public Function Relative_Y(ByVal INT_PARAM1 As Integer) As Integer
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de Relative_Y()", "")
        Return (_Parent.SKINIMG_Fond_Ecran.Height / 720) * INT_PARAM1
    End Function

    Public Sub GUI_Echelle(ByVal OBJ_PARAM1 As Object)
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de GUI_Echelle()", "")
        Dim Propriete As System.Reflection.PropertyInfo
        Dim INT_Valeur As Integer
        Propriete = OBJ_PARAM1.GetType().GetProperty("Width")
        INT_Valeur = Propriete.GetValue(OBJ_PARAM1, Nothing)
        INT_Valeur = (INT_Valeur / 1280) * GUIGraphicsContext.SkinSize.Width
        Propriete.SetValue(OBJ_PARAM1, INT_Valeur, Nothing)
        Propriete = OBJ_PARAM1.GetType().GetProperty("Height")
        INT_Valeur = Propriete.GetValue(OBJ_PARAM1, Nothing)
        INT_Valeur = (INT_Valeur / 720) * GUIGraphicsContext.SkinSize.Height
        Propriete.SetValue(OBJ_PARAM1, INT_Valeur, Nothing)
        Propriete = OBJ_PARAM1.GetType().GetProperty("XPosition")
        INT_Valeur = Propriete.GetValue(OBJ_PARAM1, Nothing)
        INT_Valeur = (INT_Valeur / 1280) * GUIGraphicsContext.SkinSize.Width
        Propriete.SetValue(OBJ_PARAM1, INT_Valeur, Nothing)
        Propriete = OBJ_PARAM1.GetType().GetProperty("YPosition")
        INT_Valeur = Propriete.GetValue(OBJ_PARAM1, Nothing)
        INT_Valeur = (INT_Valeur / 720) * GUIGraphicsContext.SkinSize.Height
        Propriete.SetValue(OBJ_PARAM1, INT_Valeur, Nothing)
    End Sub

    Public Sub GUI_Echelle_Elements()
        MediaPortal.GUI.Library.Log.Debug("[SMC] Skin.vb >> Execution de GUI_Echelle_Elements()", "")
        GUI_Echelle(_Parent.SKINIMG_Fond_Ecran)
        GUI_Echelle(_Parent.SKINIMG_Jaquette)
        GUI_Echelle(_Parent.SKINTXT_Synopsis)
        GUI_Echelle(_Parent.SKINLBL_Heure)
        GUI_Echelle(_Parent.SKINIMG_Curseur)
        GUI_Echelle(_Parent.SKINIMG_Page_Haut)
        GUI_Echelle(_Parent.SKINIMG_Page_Bas)
        GUI_Echelle(_Parent.SKINLBL_Titre)
        GUI_Echelle(_Parent.SKINIMG_FondTitre)
        GUI_Echelle(_Parent.SKINIMG_FondHeure)
        GUI_Echelle(_Parent.SKINIMG_BordJaquette)
        GUI_Echelle(_Parent.SKINIMG_Separateur00)
        GUI_Echelle(_Parent.SKINIMG_Type00)
        GUI_Echelle(_Parent.SKINLBL_Texte00)
        GUI_Echelle(_Parent.SKINIMG_Vu00)
        GUI_Echelle(_Parent.SKINIMG_Separateur01)
        GUI_Echelle(_Parent.SKINIMG_Type01)
        GUI_Echelle(_Parent.SKINLBL_Texte01)
        GUI_Echelle(_Parent.SKINIMG_Vu01)
        GUI_Echelle(_Parent.SKINIMG_Separateur02)
        GUI_Echelle(_Parent.SKINIMG_Type02)
        GUI_Echelle(_Parent.SKINLBL_Texte02)
        GUI_Echelle(_Parent.SKINIMG_Vu02)
        GUI_Echelle(_Parent.SKINIMG_Separateur03)
        GUI_Echelle(_Parent.SKINIMG_Type03)
        GUI_Echelle(_Parent.SKINLBL_Texte03)
        GUI_Echelle(_Parent.SKINIMG_Vu03)
        GUI_Echelle(_Parent.SKINIMG_Separateur04)
        GUI_Echelle(_Parent.SKINIMG_Type04)
        GUI_Echelle(_Parent.SKINLBL_Texte04)
        GUI_Echelle(_Parent.SKINIMG_Vu04)
        GUI_Echelle(_Parent.SKINIMG_Separateur05)
        GUI_Echelle(_Parent.SKINIMG_Type05)
        GUI_Echelle(_Parent.SKINLBL_Texte05)
        GUI_Echelle(_Parent.SKINIMG_Vu05)
        GUI_Echelle(_Parent.SKINIMG_Separateur06)
        GUI_Echelle(_Parent.SKINIMG_Type06)
        GUI_Echelle(_Parent.SKINLBL_Texte06)
        GUI_Echelle(_Parent.SKINIMG_Vu06)
        GUI_Echelle(_Parent.SKINIMG_Separateur07)
        GUI_Echelle(_Parent.SKINIMG_Type07)
        GUI_Echelle(_Parent.SKINLBL_Texte07)
        GUI_Echelle(_Parent.SKINIMG_Vu07)
        GUI_Echelle(_Parent.SKINIMG_Separateur08)
        GUI_Echelle(_Parent.SKINIMG_Type08)
        GUI_Echelle(_Parent.SKINLBL_Texte08)
        GUI_Echelle(_Parent.SKINIMG_Vu08)
        GUI_Echelle(_Parent.SKINIMG_Separateur09)
        GUI_Echelle(_Parent.SKINIMG_Type09)
        GUI_Echelle(_Parent.SKINLBL_Texte09)
        GUI_Echelle(_Parent.SKINIMG_Vu09)
        GUI_Echelle(_Parent.SKINIMG_Separateur10)
        GUI_Echelle(_Parent.SKINIMG_Type10)
        GUI_Echelle(_Parent.SKINLBL_Texte10)
        GUI_Echelle(_Parent.SKINIMG_Vu10)
        GUI_Echelle(_Parent.SKINIMG_Separateur11)
        GUI_Echelle(_Parent.SKINIMG_Type11)
        GUI_Echelle(_Parent.SKINLBL_Texte11)
        GUI_Echelle(_Parent.SKINIMG_Vu11)
        GUI_Echelle(_Parent.SKINIMG_Separateur12)
        GUI_Echelle(_Parent.SKINIMG_Type12)
        GUI_Echelle(_Parent.SKINLBL_Texte12)
        GUI_Echelle(_Parent.SKINIMG_Vu12)
        GUI_Echelle(_Parent.SKINIMG_Separateur13)
        GUI_Echelle(_Parent.SKINIMG_Type13)
        GUI_Echelle(_Parent.SKINLBL_Texte13)
        GUI_Echelle(_Parent.SKINIMG_Vu13)
        GUI_Echelle(_Parent.SKINIMG_Separateur14)
        GUI_Echelle(_Parent.SKINIMG_Type14)
        GUI_Echelle(_Parent.SKINLBL_Texte14)
        GUI_Echelle(_Parent.SKINIMG_Vu14)
        GUI_Echelle(_Parent.SKINIMG_Separateur15)
    End Sub

End Class
